﻿<Window x:Class="Samba.Presentation.Terminal.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Terminal="clr-namespace:Samba.Presentation.Terminal" Title="Samba Terminal Shell" Height="320" Width="240">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Border Visibility="{Binding IsLoggedUserVisible,Converter={StaticResource VisibilityConverter}}">
            <Terminal:LoggedInUserView DataContext="{Binding LoggedInUserViewModel}"/>
        </Border>
        <TabControl Padding="1" Margin="0,-2,0,0" Grid.Row="1" SelectedIndex="{Binding SelectedIndex,FallbackValue=0}">
            <TabControl.ItemContainerStyle>
                <Style TargetType="{x:Type TabItem}">
                    <Setter Property="Visibility" Value="Collapsed"/>
                </Style>
            </TabControl.ItemContainerStyle>
            <Terminal:LoginView DataContext="{Binding LoginViewModel}"/>
            <Terminal:DepartmentSelectorView DataContext="{Binding DepartmentSelectorViewModel}"/>
            <TabControl SelectedIndex="{Binding SelectedTicketViewIndex}" Padding="0" Margin="0,-2,0,0" BorderThickness="0">
                <TabControl.ItemContainerStyle>
                    <Style TargetType="{x:Type TabItem}">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </Style>
                </TabControl.ItemContainerStyle>
                <Terminal:TableScreenView DataContext="{Binding TableScreenViewModel}"/>
                <Terminal:TicketScreenView DataContext="{Binding TicketScreenViewModel}"/>
            </TabControl>
            <Terminal:TicketEditorView DataContext="{Binding TicketEditorViewModel}"/>
            <Terminal:MenuItemSelectorView DataContext="{Binding MenuItemSelectorViewModel}"/>
            <Terminal:SelectedTicketItemEditorView DataContext="{Binding SelectedTicketItemEditorViewModel}"/>
        </TabControl>
    </Grid>
</Window>
